home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 025a / intouch.zip / BLD_DBF.DOC < prev    next >
Text File  |  1991-11-10  |  11KB  |  247 lines

  1. Creation Date: 11/01/1987                             Last Modified: 02/08/1988
  2.  
  3.  
  4.  
  5.  
  6.                                  BLD_DBF
  7.  
  8.  
  9.                        Build a dBase III Compatbable
  10.                            database file from DOS
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.                       Author : Richard P. Hendricks
  18.  
  19.                       Version: 1.2
  20.                       Date   : Feb 08, 1988
  21.  
  22.                         COPYRIGHT (C) 1987, 1988
  23.  
  24.  
  25. DESCRIPTION:
  26.  
  27. BLD_DBF allows the user to create and load a dBase III compatable database
  28. file. The structure of the database is defined by an ASCII file that contains
  29. the structure specification. There are several options/switches that can be 
  30. used to influence the contents of the database. The loading process is similar
  31. to the APPEND FROM ... SDF. 
  32.  
  33. COMPATABILITY:
  34.  
  35. BLD_DBF will create database files that are compatable with:
  36.  
  37.           * QuickSilver              * Clipper
  38.           * dBase III                * Alpha/three
  39.           * dBase III Plus
  40.  
  41. USAGE:
  42.  
  43. BLD_DBF is written to allow for data to be piped and filtered into it. The data
  44. can come from another command such as DIR or from an ASCII file. There are 
  45. several swtiches that are available to affect the loading. The case of the
  46. command line arguments is not important. The case of the data that is to be
  47. loaded is preserved.
  48.  
  49. Drive and Path designations can be use along with all the file entries.
  50.  
  51. COMMAND SYNTAX:
  52.  
  53.   BLD_DBF [ struc_file dbf_name [ switches ] <data_src [ >log_file ] ]
  54.                            -or-
  55.   [ command(s) | ] BLD_DBF [ struc_file dbf_name [ switches ] [ >log_file ] ]
  56.  
  57.    STRUC_FILE  - the name of the ASCII sequential file that contains the
  58.                  structure of the database. One line for each field. The
  59.                  field name, type, length and decimal places are all separated
  60.                  by one or more spaces. The dBase III standards are enforced
  61.                  and all types are supported except for memo fields. The default
  62.                  extension for this file is .STR  . If the default structure of
  63.                  TEXT C 80 0 is desired, enter *DEFAULT* in place of the
  64.                  structure file name.
  65.  
  66.                  A special field type has been established. If the field type
  67.                  is set to 'X' then the data will be read from the input stream
  68.                  but the field description and related data will not be loaded
  69.                  into the database. This is useful for skipping over unwanted
  70.                  data, such as spaces, record numbers, etc. The length and 
  71.                  decimal places are the same as that of the character type,
  72.                  ie, 254 and 0.
  73.                   
  74.    DBF_NAME    - the name of the database file to be created. If the database
  75.                  file already exists, then it will be overwritten without
  76.                  warning. The default extension for this file is .DBF  .
  77.  
  78.    SWITCHES    - there are several switches that can be used to affect the 
  79.                  loading process. The character that is used to identify 
  80.                  that the input is a switch or group of switches is a '/'.
  81.  
  82.                  Switches can be entered on the line individually or grouped
  83.                  together. Example: /e /p  can be specified as /ep
  84.  
  85.                  The switches are:
  86.  
  87.                    E      - create an empty database. The structure of the
  88.                             database is stored, but no records are added to 
  89.                             the database. There is no need to supply the
  90.                             information related to the source of the data.
  91.  
  92.                    P      - load the database is protect mode. Each time a
  93.                             record is added to the database the record count
  94.                             is also stored. This method is slower and under
  95.                             most circumstances is not needed. The default is
  96.                             to store the record count after all the records 
  97.                             have been loaded.
  98.  
  99.                    S      - abort the loading process if the incoming data
  100.                             is too short for the specified structure. The
  101.                             default is to pad the field with spaces.
  102.  
  103.                    L      - abort the loading process if the incoming data
  104.                             is too long for the specified structure. The
  105.                             default is to truncate the records that are too
  106.                             long.
  107.  
  108.                    X      - abort the loading process if the incoming data
  109.                             is not the exact length for the specified structure.
  110.                             The default is to pad the short fields with spaces
  111.                             and truncate the records that are too long.
  112.  
  113.                    M:nnn  - skip the incoming record if the incoming data is
  114.                             less than the length that is specified by nnn. This
  115.                             is useful in keeping out data that is of a different
  116.                             format, but is in the input stream. An example is
  117.                             with the directory command. The data related to the
  118.                             file information is 40 characters long and the
  119.                             titles, etc are 39 or less. By specifying nnn = 39
  120.                             then only the file information will be loaded.
  121.  
  122.                    Q      - load in a quite mode. BLD_DBF does not report alot
  123.                             of information back to the screen, but there is
  124.                             some. If you are running BLD_DBF within a program
  125.                             using RUN/! then you may not want any messages to
  126.                             be sent to the screen. The use of a log file might
  127.                             also accomplish this. Errors are not surpress by
  128.                             this option, only warnings and informative messages.
  129.  
  130.                    ?      - provide on line help. BLD_DBF will return to the
  131.                             screen a summary of this documentation. The 
  132.                             information can be directed to a file or printer.
  133.                             See log file command line argument. This information
  134.                             will also be displayed if only BLD_DBF is entered 
  135.                             at DOS.
  136.                           
  137.    DATA_SRC    - the name of the ASCII file that contains the data to be loaded
  138.                  into the database file. The data should be configured so that
  139.                  the specified field lengths can be used to separate the data.
  140.                  This is similar to the dBase III command APPEND FROM ... SDF.
  141.                  There is no default extension for this file. If a source of
  142.                  the data is not supplied then BLD_DBF is directed by DOS to
  143.                  read the input from the console. To exit this situation, press
  144.                  Ctrl-Z and [Enter]. The '<' character tells DOS to feed to 
  145.                  BLD_DBF the information that is found in the file.
  146.  
  147.    LOG_FILE    - the name of the file or device that is to recieve the
  148.                  informative messages, warnings and error messages. The only
  149.                  screen output that cannot be redirected is the 25 CR's that
  150.                  are issued to clear the screen when Help ( /? ) is asked for.
  151.                  The '>' character tells DOS to direct the screen output from
  152.                  BLD_DBF to the designated file or device. The '>>' will cause
  153.                  the screen output to be appended to the designated file or
  154.                  device.
  155.  
  156.                  For example: BLD_DBF /? >PRN will direct the on line help to
  157.                  the printer.
  158.  
  159.   COMMAND(S)   - other programs or commands can generate the data that is to be
  160.                  loaded into the database. A good example is the DIR command.
  161.                  The output from the DIR command can be passed to the BLD_DBF
  162.                  program to be loaded into database file. For example:
  163.  
  164.                     DIR | BLD_DBF *DEFAULT* DIRLIST
  165.  
  166.                  This will create a database, DIRLIST.DBF, that contains the
  167.                  output of the DIR command. The structure of the database is
  168.                  1 field with a name of TEXT, type of character, length of 80
  169.                  and decimals of 0. Other variations can be applied, such as
  170.                  sorting the data prior to loading.
  171.  
  172.                     DIR | SORT | BLD_DBF *DEFAULT* DIRLIST
  173.  
  174.                  The '|' character tells DOS to pass the screen output from
  175.                  the preceeding program or command onto the program or command
  176.                  that follows.
  177.  
  178. Example Structure Files:
  179.  
  180. File: DIR.STR - Structure to Capture Directory Information in to a database
  181.  
  182.        NAME      C 8 0
  183.        pad1      C 1 0
  184.        EXTENSION C 3 0
  185.        pad2      C 1 0
  186.        SIZE      N 8 0
  187.        pad3      C 2 0
  188.        DATE      D 8 0
  189.        pad4      C 2 0
  190.        TIME      C 5 0
  191.        AMPM      C 1 0
  192.  
  193. Usage: DIR | BLD_DBF DIR DIRLIST /M:39
  194.  
  195.        This will load the output from the DIR command into a database with
  196.        the above structure. The /m:39 switch will cause only the file data
  197.        to be loaded, ie., no titles such as 'Volume in drive B has no label'
  198.        or blank lines.
  199.  
  200. File: CHKDSK.STR - Structure to Capture CHKDSK Information in to a database
  201.  
  202.        SIZE      N  9 0
  203.        pad1      C  1 0
  204.        DESCRIPT  C 25 0
  205.  
  206. Usage: CHKDSK | BLD_DBF CHKDSK CHKDSK /M:1
  207.  
  208.        This will load the output from the CHKDSK command into a database with
  209.        the above structure. The /m:1 switch will cause only the disk and memory
  210.        data to be loaded, ie., no blank lines.
  211.  
  212. File: XDIR.STR - Structure to Capture Directory Information into a database
  213.                  without any of the spacing found between fields. Uses the 
  214.                  special field type 'X'.
  215.  
  216.        NAME      C 8 0
  217.        pad1      X 1 0
  218.        EXTENSION C 3 0
  219.        pad2      X 1 0
  220.        SIZE      N 8 0
  221.        pad3      X 2 0
  222.        DATE      D 8 0
  223.        pad4      X 2 0
  224.        TIME      C 5 0
  225.        AMPM      C 1 0
  226.  
  227. Usage: DIR | BLD_DBF XDIR XDIRLIST /M:39
  228.  
  229.        This will load the output from the DIR command into a database with
  230.        the above structure. The data corresponding to the PADx fields will 
  231.        be read, but not loaded into the database. The /m:39 switch will cause
  232.        only the file data to be loaded, ie., no titles such as
  233.        'Volume in drive B has no label' or blank lines.
  234.  
  235. File: PHONE.STR - Structure for the Phone list database
  236.  
  237.        FNAME     C 10 0
  238.        LNAME     C 15 0
  239.        AREACODE  C  3 0
  240.        PHONENUM  C  7 0
  241.  
  242. Usage: BLD_DBF PHONE PHONE <PHONE.LST
  243.  
  244.        This will load the data that is stored in the data file PHONE.LST into
  245.        the database PHONE.DBF with the structure PHONE.STR.
  246.  
  247.